/**
 * Created by Weizehua on 2017/1/12.
 */
import {Component} from "@angular/core";
import {NavController} from "ionic-angular";
import {LoginRequest} from "./LoginRequest";
import {UserService} from "../../core/UserService";
import {EvaluationPage} from "../Evaluation/EvaluationPage";
@Component({
    selector: "tc-login",
    templateUrl: "LoginPage.html",
    providers: [LoginRequest]
})
export class LoginPage {
    username: string = '18807734862';
    password: string = '12345678';

    constructor(private loginRequest: LoginRequest,
                private userService: UserService,
                public navCtrl: NavController) {
    }

    async onLoginClicked() {
        this.userService.setUserInfo(await this.loginRequest.login(this.username, this.password));
        this.navCtrl.setRoot(EvaluationPage);
    }
}

